//
//  TestVC.m
//  FamilyTree
//
//  Created by student on 16/4/15.
//  Copyright © 2016年 Five. All rights reserved.
//

#import "TestVC.h"

#import "PeopleDataManager.h"
#import "People.h"
@interface TestVC ()

@property (nonatomic,weak) PeopleDataManager *peopleManager;

@end

@implementation TestVC

- (void)viewDidLoad {
    [super viewDidLoad];
    PeopleDataManager *people = [[PeopleDataManager alloc]init];
    self.peopleManager = people;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)btnPressed:(id)sender {
    [self.peopleManager addPeopleInfoName:@"王北生"
                                      Sex: @(1)
                                    Title:@"字向南"
                                DateStart:nil
                                  DateEnd:nil
                               BirthPlace:@"河南"
                              PeopleStory:@"简介"
                                      Son:nil
                                 Daughter:nil
                                  Brother:nil
                                   Sister:nil
                              PeopleImage:@"沙盒路径"
                                 Comments:nil
                                 PeopleID:@(1)];

}


- (IBAction)quaryBtn:(id)sender {
   
    NSArray *arr =  [self.peopleManager quaryAllPeopleInfo];
    for (People *p in arr) {
        NSLog(@"性别:%@",p.name);
        NSLog(@"性别:%@",p.sex);
        NSLog(@"简介:%@",p.peopleStory);
        NSLog(@"头像路径:%@",p.peopleImage);
    }
}

- (IBAction)clearData:(id)sender {
    [self.peopleManager deleteAllPeopleInfo];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
